package com.liu.util;

import com.liu.dao.*;
import com.liu.dao.impl.*;

/**
 * @Author 老刘Matthew
 * @Timestamp 2022/7/21 19:30
 * @Description Singleton DaoFactory in Lazy Mode
 */
public class DaoFactory {

    private static IUserDao userDao = null;

    private static INovelDao novelDao = null;

    private static IReadLogDao readLogDao = null;

    private static IFavoriteDao favoriteDao = null;

    private static IRateDao rateDao = null;

    private static IChapterDao chapterDao = null;


    public static INovelDao getNoVelDao() {

        novelDao = new NovelDaoImpl();
        return novelDao;
    }

    public static IUserDao getUserDao() {

        userDao = new UserDaoImpl();
        return userDao;
    }

    public static IFavoriteDao getFavoriteDao() {

        favoriteDao = new FavoriteDaoImpl();
        return favoriteDao;
    }

    public static IRateDao getRateDao() {

        rateDao = new RateDaoImpl();
        return rateDao;
    }

    public static INovelDao getNovelDao() {

        novelDao = new NovelDaoImpl();
        return novelDao;
    }

    public static IChapterDao getChapterDao() {

        chapterDao = new ChapterDaoImpl();
        return chapterDao;
    }

    public static IReadLogDao getReadLogDao() {

        readLogDao = new ReadLogDaoImpl();
        return readLogDao;
    }

}

